<?php
# This file is part of "Central heating manager".

# "Central heating manager" is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# "Central heating manager" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with "Central heating manager".  If not, see <http://www.gnu.org/licenses/>.



require_once('inc/config.inc.php');

// Récupération des infos
$zones = getZones();
$modes = getModes();

affHeader(array());

?>
<div data-role="header"> 
	<h1>Gestion du chauffage</h1>
</div> 
<div data-role="content">

<ul data-role="listview" data-inset="true" data-divider-theme="a">
	<li data-role="list-divider">Zones</li>
	<?php
//print_r($zones);
	foreach ($zones as $zoneid => $zone){
	
		$zonemode = $modes[$zone['modeid']];
		//$theme = $zonemode['theme']	!= '' ? $zonemode['theme'] : 'b';
//ajouter mode en cours pour auto
		echo '<li><a href="zone.php?zoneid='.$zone['id'].'"><img src="img/'.$zone['modeid'].'_color.png" class="ui-li-icon"/> '.$zone['nom'].'</a></li>';
	}
	?>

</ul>
</div>
<?php
affFooter();
?>